

<%@ page import="givenchy.TaskGroup" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'taskGroup.label', default: 'TaskGroup')}" />
        <title>添加任务组</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
            <span class="menuButton"><g:link class="list" action="list">任务组列表</g:link></span>
        </div>
        <div class="body">
            <h1>添加任务组<br><a href="javascript:" rel="tipsy" title="<font color='#000'>时间限定：</font>指定一天中每一个小时，你希望被刷的次数，一个任务组中一次只能有一个任务被执行。<br><font color='#000'>点击质量：</font>是否为广告组：设置此项后，此任务组下的所有任务都按照广告任务对待，请将所有广告任务添加到此类型的组中。<br><font color='#000'>点击质量：</font>此项针对广告点击，设置每IP两次点击同一广告需要间隔的时间，最小值为24，只针对3级VIP用户，普通用户没有此项。">点击查看提示</a></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${taskGroupInstance}">
            <div class="errors">
                <g:renderErrors bean="${taskGroupInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" name="taskGroupForm">
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name" >
                                    <label for="name">名称</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" value="${taskGroupInstance?.name}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="description">描述</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'description', 'errors')}">
                                    <g:textField name="description" value="${taskGroupInstance?.description}" />
                                </td>
                            </tr>
                         
                        
 <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="hourRate">时间限定</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'hourRate', 'errors')}">
                                    <font size="2" color="blue"> 24小时，每一小时希望的点击量</font>
                                    <input type="hidden" name="hourRate" value="">
                                    <table>
                                        <tr>   
                                           <g:each in="${0..11}" var="hour">                                            
                                               <td  style="padding: 0">                                                
                                                 <input type="text" name="rate" class="rate" value="${hour in Integer ?  0 : hour?.rate}" 
                                                 size="4" style="width:30px;">
                                                </td>   
                                           </g:each>
                                        </tr> 
                                        <tr> 
                                            <g:each in="${0..11}" var="hour">
                                                   <td>
                                                    <font size="" color="red">${hour}点</font>
                                                    </td> 
                                               </g:each> 
                                        </tr>
                                        <tr>   
                                           <g:each in="${12..23}" var="hour">                                            
                                               <td  style="padding: 0">                                                
                                                 <input type="text" name="rate" class="rate" value="${hour in Integer ?  0 : hour?.rate}" 
                                                 size="4" style="width:30px;">
                                                </td>   
                                           </g:each>
                                        </tr> 
                                        <tr> 
                                            <g:each in="${12..23}" var="hour">
                                                   <td>
                                                    <font size="" color="red">${hour}点</font>
                                                    </td> 
                                               </g:each> 
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                          
                        <g:if test="${loggedInUserInfo(field:'vip').toInteger() > 2}">
                            <tr class="prop">
                                <td valign="top" class="name"><label for="isAd">是否广告组</label></td>
                                <td valign="top" class="value ${hasErrors(taskGroupInstance,field:'isAd','errors')}">
                                    <input type="checkbox" name="isAd" style="border:0px;"/>
                                </td>
                            </tr>


                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="requireOfIP">点击质量</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'requireOfIP', 'errors')}">
                                    <g:textField name="requireOfIP" value="${fieldValue(bean: taskGroupInstance, field: 'requireOfIP')}" />小时  <font size="2" color="blue">每次每IP在多少小时之内不能再次点击，最小值为24此项只为广告任务起作用。</font>
                                </td>
                            </tr>
                        </g:if>

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="完成" /></span>
                </div>
            </g:form>
        </div>
        <g:javascript src="validate/jquery.validate.js" type="text/javascript"/>
        <g:javascript src="domain/taskGroup_create.js" type="text/javascript"/>
    </body>
</html>
